<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
    <title>{$tkd.title|parseTpl}</title>
    <meta name="keywords" content="{$tkd.keywords|parseTpl}">
    <meta name="description" content="{$tkd.description|parseTpl}">
	<link rel="stylesheet" href="{$kx.config.resurl}/template/kxwebno1/css/global.css"/>
	<link rel="stylesheet" href="{$kx.config.resurl}/template/kxwebno1/css/style.css"/>
	<script src="{$kx.config.resurl}/template/kxwebno1/js/jquery-3.3.1.js"></script>
    <link rel="shortcut icon" type="image/ico" href="/favicon.ico" />
    <meta name="author" content="www.ptcms.com">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width" />
    <meta name="applicable-device" content="pc">
    <meta http-equiv="mobile-agent" content="format=html5; url={$kx.config.mobileurl}__SELF__">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta http-equiv="Cache-Control" content="no-transform" />
    <link rel="canonical" href="{$kx.config.pcurl}__SELF__" />
</head>
<body>
	<!-- 头部 -->
    {include file="/author/system/header"}

	<!-- 内容 -->
	<div class="pt-content mt10">
		<!-- 一楼 -->
		<div class="pt-floor1">
			<div class="pt-list">
				<!-- 人气榜单 -->
                <div class="fr pt-toplist">
                    <div class="border-b size18 color8 pb10 pt-toplist-title">人气榜单</div>
                    <div class="pt-toplist-item">
                        {block method="rank.out" name=list}
                        {loop}
                        <a title="{$loop.name}" href="{link=novel.rank.list key=$loop.key}"><span class="mr10">·</span>{$loop.name}</a>
                        {/loop}
                    </div>
                </div>
                <!-- 站内榜单 -->
                <div class="fr pt-sortlist">
                    <div class="border-b size18 color8 pb10 pt-sortlist-title">站内榜单</div>
                    {block method="rank.list" name=list}
                    {loop=list}
                    <div class="pt-sortlist-item fl" style="width:50%">
                        <a title="{$loop.name}" class="color8 fl" href="{link=novel.rank.list key=$loop.key}">{$loop.name}</a>
                    </div>
                    {/loop}
                </div>
			</div>
            {block method="pagination" name="paginate" page=$page limit=$pagesize count=$author.num maxpage=50 section=3}
            <div class="relative pt-rank">
				<div class="pt-rank-head">
					<span class="size18 color2 mr10">{$author.name} 作品大全</span>
				</div>
                {block method="novel.list" name=list author=$author.id num=$paginate.limit page=$paginate.current}
                {section loop=$list item=$loop}
                <div class="pt-rank-detail">
                    <a href="{link=novel.novel.index novelid=$loop.novel.id pinyin=$loop.novel.pinyin}">
                        <img src="{$loop.novel.cover}">
                    </a>
                    <div class="fl pt-rank-detail-middle">
                        <div class="fl w100 title">
							<span class="fl mr60">
								{if $page==1}<span class="{=$i.index<3?'bg-red':'bg-ccc'} pt-sexselect-square">{$i.order}</span>{/if}
								<a href="{link=novel.novel.index novelid=$loop.novel.id pinyin=$loop.novel.pinyin}" class="size18 color2">{$loop.novel.name}</a>
							</span>
                            <span class="fl color7">
								<span class="mr30">作者：<a href="{link=author.space.index authorid=$loop.author.id pinyin=$loop.author.pinyin name=$loop.author.name}">{$loop.author.name}</a> </span>
								<span>分类：
                                    <a href="{link=novel.category.list id=$loop.category.id key=$loop.category.key}">{$loop.category.name}</a>
                                </span>
							</span>
                            <span class="fr color5">{$loop.data.allvisit} 人在读</span>
                        </div>
                        <div class="compulsory-row fl w100 color5 desc">
                            {$loop.novel.intro|showIntroLine}
                        </div>
                        <div class="fl lh100">
                            {if $loop.last.id}
                            <span>
                                最新更新：
                                <a href="{link=novel.chapter.read novelid=$loop.novel.id pinyin=$loop.novel.pinyin chapterid=$loop.last.id}">
                                    <span class="color2 mr20">{$loop.last.name}</span>
                                </a>
                            </span>
                            <span class="color0 size12">{$loop.last.last_update}</span>
                            {else}
                            <span>最新更新：<span class="color0 mr20">{$loop.last.name}</span></span>
                            {/if}
                        </div>
                    </div>
                    <div class="fr mr30">
                        <a href="{link=novel.novel.index novelid=$loop.novel.id pinyin=$loop.novel.pinyin}" class="mb20 color2 border-red pt-btn read">立即阅读</a>
                        {if $islogin}
                        {block method="mark.check" name=$ismark userid=$userinfo.id novelid=$loop.novel.id}
                        <a href="javascript:void(0);" class="border-c9 color4 pt-btn btn-mark" data-novel-id="{$loop.novel.id}">{$ismark|default='加入收藏','取消收藏'}</a>
                        {else}
                        <a href="javascript:void(0);" class="border-c9 color4 pt-btn btn-mark" data-novel-id="{$loop.novel.id}">加入收藏</a>
                        {/if}
                    </div>
                </div>
                {/section}
				<!-- 分页 -->
                {if $paginate.total>1}
                <div class="pt-pages">
                    <div class="pt30 color5">
                        {if $paginate.prev}
                        <a href="{link=author.space.index authorid=$kx.get.authorid pinyin=$kx.get.pinyin name=$kx.get.name page=$paginate.prev}"><span><</span></a>
                        {else}
                        <span class="disable"><</span>
                        {/if}
                        {loop=paginate.items}
                        <a href="{link=author.space.index authorid=$kx.get.authorid pinyin=$kx.get.pinyin name=$kx.get.name page=$loop.num}">
                            <span class="{$loop.status|default='','pt-pages-select'}">{$loop.num}</span>
                        </a>
                        {/loop}
                        {if $paginate.next}
                        <a href="{link=author.space.index authorid=$kx.get.authorid pinyin=$kx.get.pinyin name=$kx.get.name page=$paginate.next}"><span>></span></a>
                        {else}
                        <span class="disable">></span>
                        {/if}
                    </div>
                </div>
                {/if}
			</div>
		</div>
		<!-- 友情链接 -->
	</div>

	<!-- 底部版权-->
    {include file="/author/system/footer"}
    <script>
        // 收藏
        var loading = null;
        $('.btn-mark').on('click', function () {
            var that = this, api, num = 0;
            if ($(that).text() == '加入收藏') {
                api = '{link=user.mark.add}';
            } else {
                api = '{link=user.mark.del}';
            }
            $.ajax(api, {
                type: 'post',
                dataType: 'json',
                data: {
                    'novelid': $(that).data('novel-id'),
                },
                beforeSend: function () {
                    if (loading == null) {
                        loading = layer.load(1, {shade: [0.1, '#000']});
                    }
                },
                complete: function () {
                    if (loading != null) {
                        layer.close(loading);
                        loading = null;
                    }
                },
                success: function (res) {
                    if (res.code) {
                        layer.alert(res.msg, {icon: 2,}, function (index) {
                            if (res.data.redirect) {
                                window.location.href = res.data.redirect;
                            } else {
                                layer.close(index);
                            }
                        });
                    } else {
                        layer.msg('操作成功!');
                        if ($(that).text() == '加入收藏') {
                            $(that).text('取消收藏')
                        } else {
                            $(that).text('加入收藏')
                        }
                    }
                },
                error: function () {
                    layer.alert('收藏失败，请刷新页面后重试！', {icon: 2,});
                }
            });
        });
    </script>
	<!-- js-->
	<script src="{$kx.config.resurl}/template/kxwebno1/js/rankdetail.js"></script>
</body>
</html>